[GtkTable] Add gtk_table_get_size()
authorJavier Jardón <jjardon@gnome.org>
Thu, 24 Jun 2010 15:28:18 +0000 (17:28 +0200)
committerJavier Jardón <jjardon@gnome.org>
Thu, 24 Jun 2010 15:46:12 +0000 (17:46 +0200)
Add accessor function to retrieve the number of rows and columns
in the table.

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtktable.c
gtk/gtktable.h

index 8bc5fe469922d02f7b0a9a81f8d1f1228601feb5..21dc9d1d883508d1471c9d58329dfc2ce5cc1318 100644 (file)
@@ -3081,6 +3081,7 @@ gtk_status_icon_get_type
 GtkTable
 gtk_table_new
 gtk_table_resize
+gtk_table_get_size
 gtk_table_attach
 gtk_table_attach_defaults
 gtk_table_set_row_spacing
index 84c10a14fdc870301521615f53f4329d10a4503e..e21646846eae611e5ae2b793670b3fa3c712eaf7 100644 (file)
@@ -3278,6 +3278,7 @@ gtk_table_get_default_col_spacing
 gtk_table_get_default_row_spacing
 gtk_table_get_homogeneous
 gtk_table_get_row_spacing
+gtk_table_get_size
 gtk_table_get_type G_GNUC_CONST
 gtk_table_new
 gtk_table_resize
index dd14bedecc451cf3f2138a64767945ec9bb967b3..79efc26dee532cc8fec70beab5e1a0ae32ac4e84 100644 (file)
@@ -796,6 +796,32 @@ gtk_table_get_homogeneous (GtkTable *table)
   return table->homogeneous;
 }
 
+/**
+ * gtk_table_get_size:
+ * @table: a #GtkTable
+ * @rows: (allow-none): (out): return location for the number of
+ *   rows, or %NULL
+ * @columns: (allow-none): (out): return location for the number
+ *   of columns, or %NULL
+ *
+ * Returns the number of rows and columns in the table.
+ *
+ * Since: 2.22
+ **/
+void
+gtk_table_get_size (GtkTable *table,
+                    guint    *rows,
+                    guint    *columns)
+{
+  g_return_if_fail (GTK_IS_TABLE (table));
+
+  if (rows)
+    *rows = table->nrows;
+
+  if (columns)
+    *columns = table->ncols;
+}
+
 static void
 gtk_table_finalize (GObject *object)
 {
index f993d7e8f1f806ca8127630247ac67db8bc953b3..f89958b3c04196dc18d504536a10f859e12b2fc2 100644 (file)
@@ -141,6 +141,9 @@ guint      gtk_table_get_default_col_spacing (GtkTable        *table);
 void      gtk_table_set_homogeneous  (GtkTable        *table,
                                       gboolean         homogeneous);
 gboolean   gtk_table_get_homogeneous  (GtkTable        *table);
+void       gtk_table_get_size         (GtkTable        *table,
+                                       guint           *rows,
+                                       guint           *columns);
 
 
 G_END_DECLS